<template>
  <div style="height:220px;overflow:hidden;">
    <el-card class="box-card" shadow="never">
      <div slot="header" class="clearfix">
        <span>政务信息</span>
        <div style="float: right; padding: 3px 0" type="text">
          <a @click="showDetail()">查看全部 &gt;</a>
        </div>
      </div>
      <el-table :show-header="false" :data="infos" class="left_menu_side">
        <el-table-column prop="Is_Subject" :show-overflow-tooltip="true" label="标题">-->
          <template slot-scope="scope">
            <a @click="getMore(scope.row)">{{scope.row.Is_Subject}}</a>
          </template>
        </el-table-column>
        <el-table-column prop="Uo_Name" :show-overflow-tooltip="true" label="报送单位"></el-table-column>
        <el-table-column prop="Is_SendDate" :show-overflow-tooltip="true" label="报送时间"></el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script type="text/javascript">
  import { ACCESS_TOKEN } from '@/store/mutation-types'
  import Vue from 'vue'
  import { openIFrame } from '@/utils/util'

  const ticket = Vue.ls.get(ACCESS_TOKEN)
  const baseUrl = process.env.VUE_APP_ADD_HTTP

  export default {
    name: 'government',
    data() {
      return {
        infos: [],
      }
    },
    mounted() {
      this.getAdminList()
    },
    methods: {
      showDetail() {
        let ReturnUrl = encodeURIComponent('/InfoSendView.xip')
        let url = baseUrl + '/Modules/Login/EgovPlatformLogin.aspx?LoginMethod=ssologin&ticket=' +
          ticket + '&ReturnUrl=' + ReturnUrl
        openIFrame("InfoSendView", '/InfoSendView', '信息报送系统', url)
        this.$router.push({ name: "InfoSendView" })
      },
      getMore(row) {
        let ReturnUrl = encodeURIComponent('/InfoSendView.xip?IsId=')
        let id = row.Is_Id
        let url = baseUrl + '/Modules/Login/EgovPlatformLogin.aspx?LoginMethod=ssologin&ticket=' +
          ticket + '&ReturnUrl=' + ReturnUrl + id + ''
        openIFrame(row.Is_Subject, '/InfoSendView/' + id, row.Is_Subject, url)
        this.$router.push({ name: row.Is_Subject })
      },
      getAdminList() {
        let that = this
        let params = {
          serviceName: 'Xinfo.Bus.BL.Service.EgovPlatform.SHIJU.PortalLet.NewestInfoSendPortalLetService,Xinfo.Bus.BL.Service',
          getCount: false,
          guid: 'zwxx_zxsb',
          intTypeId: 0,
          strBizType: ''
        }
        this.getRequest('/PortalLet/GetPortalLetData', params).then(res => {
          if (res) {
            res.data.forEach((row, index) => {
              if (index < 5) {
                that.infos.push(row)
              }
            })
          }
        })
      }
    }
  }
</script>